using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_EyeFormMap : EntityTypeConfiguration<so_EyeForm>
    {
        public so_EyeFormMap()
        {
            // Primary Key
            this.HasKey(t => t.Form__);

            // Properties
            this.Property(t => t.Form__)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Date)
                .IsFixedLength()
                .HasMaxLength(30);

            this.Property(t => t.Patient)
                .HasMaxLength(110);

            this.Property(t => t.Patient_id)
                .HasMaxLength(6);

            // Table & Column Mappings
            this.ToTable("so_EyeForm");
            this.Property(t => t.Form__).HasColumnName("Form_#");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Patient).HasColumnName("Patient");
            this.Property(t => t.Patient_id).HasColumnName("Patient_id");
        }
    }
}
